﻿using System;
using Character;
using UnityEngine;
using UnityEngine.UI;

// Token: 0x020001E4 RID: 484
public class EditEquipShow : MonoBehaviour
{
	// Token: 0x1700016C RID: 364
	// (get) Token: 0x06000CE7 RID: 3303 RVA: 0x0004D350 File Offset: 0x0004B550
	// (set) Token: 0x06000CE8 RID: 3304 RVA: 0x0004D358 File Offset: 0x0004B558
	public EditEquipShow.WEARSHOW wearShow { get; private set; }

	// Token: 0x1700016D RID: 365
	// (get) Token: 0x06000CE9 RID: 3305 RVA: 0x0004D364 File Offset: 0x0004B564
	// (set) Token: 0x06000CEA RID: 3306 RVA: 0x0004D36C File Offset: 0x0004B56C
	public bool acceShow { get; private set; }

	// Token: 0x06000CEB RID: 3307 RVA: 0x0004D378 File Offset: 0x0004B578
	public void Setup(Human human)
	{
		this.human = human;
		this.wearShow = EditEquipShow.WEARSHOW.AUTO;
		this.acceShow = true;
		this.wearToggles[2].interactable = (human.sex == SEX.FEMALE);
	}

	// Token: 0x06000CEC RID: 3308 RVA: 0x0004D3A8 File Offset: 0x0004B5A8
	private void Start()
	{
		this.invoke = false;
		this.wearToggles[0].isOn = true;
		this.acceToggles[0].isOn = true;
		this.invoke = true;
	}

	// Token: 0x06000CED RID: 3309 RVA: 0x0004D3D4 File Offset: 0x0004B5D4
	private void Update()
	{
	}

	// Token: 0x06000CEE RID: 3310 RVA: 0x0004D3D8 File Offset: 0x0004B5D8
	public void ChangeWearShow(int no)
	{
		if (!this.invoke)
		{
			return;
		}
		this.wearShow = (EditEquipShow.WEARSHOW)no;
		EditEquipShow.WEARSHOW wearShow = this.wearShow;
		if (this.wearShow == EditEquipShow.WEARSHOW.AUTO)
		{
			wearShow = this.auto;
		}
		this.Calc(wearShow);
	}

	// Token: 0x06000CEF RID: 3311 RVA: 0x0004D418 File Offset: 0x0004B618
	private void Calc(EditEquipShow.WEARSHOW show)
	{
		if (this.human.sex == SEX.MALE)
		{
			Male male = this.human as Male;
			MALE_SHOW show2 = (show != EditEquipShow.WEARSHOW.ALL) ? MALE_SHOW.NUDE : MALE_SHOW.CLOTHING;
			male.ChangeMaleShow(show2);
			return;
		}
		if (show == EditEquipShow.WEARSHOW.ALL)
		{
			for (int i = 0; i < 14; i++)
			{
				this.human.wears.ChangeShow((WEAR_SHOW_TYPE)i, WEAR_SHOW.ALL);
			}
			this.human.CheckShow();
		}
		else if (show == EditEquipShow.WEARSHOW.UNDERWEAR)
		{
			this.human.wears.ChangeShow(WEAR_SHOW_TYPE.TOPUPPER, WEAR_SHOW.HIDE);
			this.human.wears.ChangeShow(WEAR_SHOW_TYPE.TOPLOWER, WEAR_SHOW.HIDE);
			this.human.wears.ChangeShow(WEAR_SHOW_TYPE.BOTTOM, WEAR_SHOW.HIDE);
			this.human.wears.ChangeShow(WEAR_SHOW_TYPE.BRA, WEAR_SHOW.ALL);
			this.human.wears.ChangeShow(WEAR_SHOW_TYPE.SHORTS, WEAR_SHOW.ALL);
			this.human.wears.ChangeShow(WEAR_SHOW_TYPE.SWIMUPPER, WEAR_SHOW.HIDE);
			this.human.wears.ChangeShow(WEAR_SHOW_TYPE.SWIMLOWER, WEAR_SHOW.HIDE);
			this.human.wears.ChangeShow(WEAR_SHOW_TYPE.SWIM_TOPUPPER, WEAR_SHOW.ALL);
			this.human.wears.ChangeShow(WEAR_SHOW_TYPE.SWIM_TOPLOWER, WEAR_SHOW.ALL);
			this.human.wears.ChangeShow(WEAR_SHOW_TYPE.SWIM_BOTTOM, WEAR_SHOW.ALL);
			this.human.wears.ChangeShow(WEAR_SHOW_TYPE.GLOVE, WEAR_SHOW.ALL);
			this.human.wears.ChangeShow(WEAR_SHOW_TYPE.PANST, WEAR_SHOW.ALL);
			this.human.wears.ChangeShow(WEAR_SHOW_TYPE.SOCKS, WEAR_SHOW.ALL);
			this.human.wears.ChangeShow(WEAR_SHOW_TYPE.SHOES, WEAR_SHOW.ALL);
			this.human.CheckShow();
		}
		else if (show == EditEquipShow.WEARSHOW.NUDE)
		{
			for (int j = 0; j < 14; j++)
			{
				this.human.wears.ChangeShow((WEAR_SHOW_TYPE)j, WEAR_SHOW.HIDE);
			}
			this.human.CheckShow();
		}
	}

	// Token: 0x06000CF0 RID: 3312 RVA: 0x0004D5E4 File Offset: 0x0004B7E4
	public void ChangeAcceShow(int no)
	{
		if (!this.invoke)
		{
			return;
		}
		this.acceShow = (no == 0);
		for (int i = 0; i < 10; i++)
		{
			this.human.accessories.SetShow(i, this.acceShow);
		}
	}

	// Token: 0x06000CF1 RID: 3313 RVA: 0x0004D634 File Offset: 0x0004B834
	public void SetAuto(EditEquipShow.WEARSHOW auto)
	{
		this.auto = auto;
		if (this.wearShow == EditEquipShow.WEARSHOW.AUTO)
		{
			this.Calc(auto);
		}
	}

	// Token: 0x04000D16 RID: 3350
	[SerializeField]
	private Toggle[] wearToggles = new Toggle[4];

	// Token: 0x04000D17 RID: 3351
	[SerializeField]
	private Toggle[] acceToggles = new Toggle[2];

	// Token: 0x04000D1A RID: 3354
	private bool invoke = true;

	// Token: 0x04000D1B RID: 3355
	private Human human;

	// Token: 0x04000D1C RID: 3356
	private EditEquipShow.WEARSHOW auto = EditEquipShow.WEARSHOW.ALL;

	// Token: 0x020001E5 RID: 485
	public enum WEARSHOW
	{
		// Token: 0x04000D1E RID: 3358
		AUTO,
		// Token: 0x04000D1F RID: 3359
		ALL,
		// Token: 0x04000D20 RID: 3360
		UNDERWEAR,
		// Token: 0x04000D21 RID: 3361
		NUDE,
		// Token: 0x04000D22 RID: 3362
		NUM
	}

	// Token: 0x020001E6 RID: 486
	public enum ACCESHOW
	{
		// Token: 0x04000D24 RID: 3364
		ON,
		// Token: 0x04000D25 RID: 3365
		OFF,
		// Token: 0x04000D26 RID: 3366
		NUM
	}
}
